﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.IO;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows.Forms;
using System.Threading;

namespace Greyhound
{
    class Downloader
    {
        public async void downloadFile(String address, MainWindow tempForm)
        {
            string pfad = @"c:\Greyhound";
            if(!Directory.Exists(pfad))
            {
                Directory.CreateDirectory(pfad);
            }
            WebClient down = new WebClient();
            await down.DownloadFileTaskAsync(new Uri(address), @"c:\Greyhound\page.html");
            tempForm.setStatus();
        }
    }
}
